<!DOCTYPE html>
<head>
<?php include_once VIEWS.'inc/head.php'; ?>

<script>
function onSub(){
	var name = $.trim($('input[name=name]').val());
    if(name==""){   
        alert("姓名不能为空!");
        return false;
    }
    var email = $.trim($('input[name=email]').val());
    if(email==""){  
        alert("E-mail不能为空!");
        return false;
    }
    if(email){
        var reg = /^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/; //验证邮箱的正则表达式
        if(!reg.test(email)){
            alert("邮箱格式不正确，请您重新输入");
            return false;
        }
    }
    var nation= $.trim($('input[name=nation]').val());
    if(nation==""){  
        alert("名族不能为空");
        return false;
    }
    var age= $.trim($('input[name=age]').val());
    if(age==""){  
        alert("年龄不能为空");
        return false;
    }
    var politic= $.trim($('input[name=politic]').val());
    if(politic==""){  
        alert("政治面貌不能为空");
        return false;
    }
    var birthplace= $.trim($('input[name=birthplace]').val());
    if(birthplace==""){  
        alert("籍贯不能为空");
        return false;
    }
    var school= $.trim($('input[name=school]').val());
    if(school==""){  
        alert("毕业学校不能为空");
        return false;
    }
    var major= $.trim($('input[name=major]').val());
    if(major==""){  
        alert("专业不能为空");
        return false;
    }
    var graduation= $.trim($('input[name=graduation]').val());
    if(graduation==""){  
        alert("毕业时间不能为空");
        return false;
    }

    var telphone = $.trim($('input[name=tel]').val());
    if(telphone==""){   
        alert("联系电话不能为空!");
        return false;
    }   
    if(telphone){
        var tel=$("input[name=tel]").val();
        var p1 = /^(([0\+]\d{2,3}-)?(0\d{2,3})-)?(\d{7,8})(-(\d{3,}))?$/;
        var me = false;
        var reg0 = /^13\d{5,9}$/;
        var reg1 = /^153\d{4,8}$/;
        var reg2 = /^159\d{4,8}$/;
        var reg3 = /^15\d{5,9}$/;
        var reg4 = /^18\d{5,9}$/;
        var reg5 = /^0\d{10,11}$/;
        var my = false;
        if (p1.test(tel))me=true;
        if (reg0.test(tel))my=true;
        if (reg1.test(tel))my=true;
        if (reg2.test(tel))my=true;
        if (reg3.test(tel))my=true;
        if (reg4.test(tel))my=true;
        if (reg5.test(tel))my=true;
        if (!my && !me){
            alert('联系电话格式错误，请您输入正确的格式，比如:13456789101"');
            return false;
        }
    }
}

</script>
<style type="text/css">
    .shadow{
        -webkit-box-shadow: 0 1px 10px rgba(0,0,0,.3);
        -moz-box-shadow: 0 1px 10px rgba(0,0,0,.3);
        box-shadow: 0 1px 10px rgba(0,0,0,.3);
    }
    .jobslist-wrap{
         padding: 40px 0;
    }
    .joinus-tb{
        width: 900px;
       
    }
    .joinus-tb td {
        padding: 12px 0;
        font-size: 14px;
        line-height: 14px;
        color: #666;
    }
    .joinus-tb td.td1{
        text-align: center;
    }
    .joinus-tb td input, .joinus-tb td select, .joinus-tb td textarea {
        width: 193px;
        border: 1px solid #e7e7e7;
        outline: none;
        height: 43px;
        box-shadow: none;
        line-height: 43px;
        text-indent: 1em;
    }
    .joinus-tb td textarea{
        width: 792px;
        height: 200px;
    }
    .joinus-tb td input.grtijiao{
        display: block;
        margin: 0 auto;
        text-indent: 0;
    }
    .joinus-tb td input.grtijiao:hover{
        background-color: #018950;
        color: #fff;
    }
</style>
</head>

<body>
   <?php include_once VIEWS.'inc/header.php'; ?>
    <div class="title-bg" style="background:url(<?php if(!empty($banner['img'])):?><?php echo upload_file($banner['img']['url']); ?><?php endif;?>) no-repeat center center;"></div>
    <div class="inside-wrap" style="background:#fff">
        <div class="w1150">
            
        </div>
        <div class="w1150">
            <div class="conten forms clearfix ">
                
                <div class="content-box jobslist-wrap">

<?php if(isset($rs['id'])):?>
                    <?php echo form_open(site_url('jobs/apply'),array("enctype"=>"multipart/form-data","class"=>"form-horizontal","id"=>"frm-apply","name"=>"frm-apply","onsubmit"=>"return onSub()")); ?>
                <table border="0" align="center" cellpadding="0" cellspacing="0" class="joinus-tb">
                    <tr>
                        <td width="" class="td1"><p>姓 名：</p></td>
                        <td width="" class="td2"><input type="text" id="name" name="name" class="feedback_input"><span id="spred">*</span></td>
                        <td width="" class="td1"><p>性 别：</p></td>
                        <td width="" class="td2"><select name="gender" class="feedback_input">
                                <option value="男">男</option>
                                <option value="女">女</option>
                            </select><span id="spred">*</span></td>
                        <td width="" class="td1"><p>婚 姻：</p></td>
                        <td width="" class="td2" align="left" class="joinus_tb_td tdleft"><select name="marriage" class="feedback_input">
                                <option value="未婚">未婚</option>
                                <option value="已婚">已婚</option>
                                <option value="离异">离异</option>
                            </select><span id="spred">*</span></td>
                    </tr>
                    <tr>
                        <td class="td1"><p>E-mail：</p></td>
                        <td class="td2"><input type="text" class="feedback_input" value="" name="email"><span id="spred">*</span></td>
                        <td class="td1"><p>民 族：</p></td>
                        <td class="td2"><input type="text" class="feedback_input"  value="" name="nation"><span id="spred">*</span></td>
                        <td class="td1"><p>年 龄：</p></td>
                        <td class="td2"  align="left" class="joinus_tb_td tdleft"><input type="text" class="feedback_input"  value="" name="age"><span id="spred">*</span></td>
                    </tr>
                    <tr>
                        <td class="td1"><p>政治面貌：</p></td>
                        <td class="td2"><input type="text" class="feedback_input" value="" name="politic"><span id="spred">*</span></td>
                        <td class="td1"><p>籍 贯：</p></td>
                        <td class="td2"><input type="text" class="feedback_input" value="" name="birthplace"><span id="spred">*</span></td>
                        <td class="td1"><p>文化程度：</p></td>
                        <td class="td2" align="left" class="joinus_tb_td tdleft">
                            <select name="edu" class="feedback_input" >
                                <option value="本科">本科</option>
                                <option value="硕士">硕士</option>
                                <option value="博士">博士</option>
                                <option value="博士后">博士后</option>
                                <option value="专科">专科</option>
                                <option value="高中">高中</option>
                                <option value="初中或以下">初中或以下</option>
                            </select><span id="spred">*</span></td>
                    </tr>
                    <tr>
                        <td class="td1"><p>毕业学校：</p></td>
                        <td class="td2"><input type="text" class="feedback_input" value="" name="school"><span id="spred">*</span></td>
                        <td class="td1"><p>专 业：</p></td>
                        <td class="td2"><input type="text" class="feedback_input" value="" name="major"><span id="spred">*</span></td>
                        <td class="td1"><p>毕业时间：</p></td>
                        <td class="td2" align="left" class="joinus_tb_td tdleft"><input type="text" class="feedback_input" value="" name="graduation"><span id="spred">*</span></td>
                    </tr>
                    <tr>
                        <td class="td1"><p>外语水平：</p></td>
                        <td class="td2"><input type="text" class="feedback_input" value="" name="language"></td>
                        <td class="td1"><p>应聘职位：</p></td>
                        <td class="td2"><input type="text" readonly="1" class="feedback_input" value="<?php echo $rs['title']; ?>" name="position">
		                        						<input type="hidden" readonly="1" class="feedback_input" value="<?php echo $rs['cid']; ?>" name="recruit_id">
                        <td class="td1"><p>联系电话：</p></td>
                        <td class="td2" align="left" class="joinus_tb_td tdleft"><input type="text" class="feedback_input" value="" name="tel"><span id="spred">*</span></td>
                    </tr>
                    <tr>
                        <td class="td1" style="vertical-align: top;"><p>个人简历：</p></td>
                        <td class="td3" colspan="5"><label for="content"><textarea class="feedback_input" id="content" name="content"></textarea><span id="spred"></span></label></td>
                    </tr>
                    
                    <tr>
                        <td class="td1"></td>
                        <td colspan="5" style="padding:10px 0;">
                            <input type="submit" class="submit grtijiao" value="提交">
                        </td>
                    </tr>
                </table>
<?php 
    else:
    header("Location:".site_url('jobs/index'));
    exit;
?>
<?php endif;?>
              
                    <div class="clear"></div>
                </div>
            </div>
            <div class="clear"></div>
        </div>
    </div>
    <?php include_once VIEWS.'inc/footer.php'; ?>
   

<script>
	$('.idea-cont .ideatitle li').eq(1).addClass('curr').siblings().removeClass('curr');
	
	$('.navlist .menus li').eq(5).addClass('b-line');
	focushide();
</script>
</body>
</html>